<?
    if(isset($style_data)) {
        foreach($style_data as $row){
            $style_id = $row->id;
            $style_name = $row->name;        
        } 
    }else{
        $style_id = false;
        $style_name = '';
    }
?>
<script>style_id = '<?=$style_id?>'; </script>
<div id="heading">
    <div id="headinginner">
        <h1><span> <? if (isset($style_data)){echo $style_name;}else echo'Moj stil'?> </span> podešavanja</h1>
        <p class="clear"></p>
    </div>                                         
</div>
<div id="stage-inner">
    <div id="stageinnerhead">
        <h2><? if (isset($style_data)){echo 'Uredite spostveni stil';}else echo'Kreirajte sopstveni stil'?></h2>    
    </div>
    <form accept-charset="UTF-8" action="javascript:void(0)" name="formSTYLE" id="formSTYLE" method="post">
        <!--STYLE NAME-->
        <div class="box nopadding">
            <div class="forminner">                                                                        
                <div style="width: 730px;" class="left">
                    <h4>Ime stila</h4>
                    <input type="text" value="<? if (isset($style_data)){echo $style_name;}?>" name="style_name" maxlength="160" style="width: 690px;" class="elmbigred" id="style_name">
                    <p class="clear"></p>
                    <div style="display: none;" class="ValidationErrors" id="question_error"></div>
                </div>                   
                <div class="left">
                    <h5>Ovaj stil se zasniva na stilu:</h5>
                    <div class="dividersmall2"></div>
                    <select name="styleID" id="styleID" style="width: 190px;">
                        <option value="0">-- Odaberite</option>
                        <?
                            foreach($styles as $row){
                            ?>
                            <option value="<?=$row->id?>"><?=$row->name?></option>
                            <?}?> 
                    </select>
                </div>
                <p class="clear"></p>
            </div> 
        </div>
        <!--END POOL NAME-->
        <div class="dividersmall2"></div>
        <!--EDIT STYLE-->
        <div style="width: 570px; min-height: 380px;" class="box nopadding left">
            <div class="forminner">
                <h4>CSSE editor</h4>
                <div class="vse">
                    <div class="main">   
                        <a id="a-lss-box" href="javascript:renderStyleEdit('lss-box');" class="top">Polje ankete</a>
                        <a id="a-lss-question-top" href="javascript:renderStyleEdit('lss-question-top');" class="">Pitanje</a>
                        <div class="split"></div>
                        <a id="a-lss-answer-group" href="javascript:renderStyleEdit('lss-answer-group');" class="">Odgovor grupa</a>
                        <a id="a-lss-answer-input" href="javascript:renderStyleEdit('lss-answer-input');" class="">Odgovor check</a>
                        <a id="a-lss-answer" href="javascript:renderStyleEdit('lss-answer');" class="">Odgovori</a>
                        <div class="split"></div>
                        <a id="a-lss-textfield" href="javascript:renderStyleEdit('lss-textfield');" class="">Polje ostalo</a>
                        <a id="a-lss-vote-button" href="javascript:renderStyleEdit('lss-vote-button');" class="">Glasaj dugme</a>
                        <a id="a-lss-view-results" href="javascript:renderStyleEdit('lss-view-results');" class="">Rezultati dugme</a>
                        <a id="a-lss-link" href="javascript:renderStyleEdit('lss-link');" class="">Linkovi</a>
                        <div class="split"></div>
                        <a id="a-lss-answer-feedback" href="javascript:renderStyleEdit('lss-answer-feedback');" class="">Rezultati pozadina</a>
                        <a id="a-lss-answer-feedback-bar" href="javascript:renderStyleEdit('lss-answer-feedback-bar');" class="">Rezultati bar</a>
                        <a id="a-lss-totalvotes-inner" href="javascript:renderStyleEdit('lss-totalvotes-inner');" class="bottom">Ukupno glasova</a>
                    </div>
                    <div class="sub">  
                        <a id="A_Font" href="javascript:CSSE_changeView('Font');" style="display: none;" class="">Font</a>
                        <a id="A_Background" href="javascript:CSSE_changeView('Background');" style="display: none;" class="">Pozadina</a>
                        <a id="A_Border" href="javascript:CSSE_changeView('Border');" style="display: none;" class="">Okvir</a>
                        <a id="A_Margin" href="javascript:CSSE_changeView('Margin');" style="display: none;" class="">Margina</a>
                        <a id="A_Padding" href="javascript:CSSE_changeView('Padding');" style="display: none;" class="">Postavka</a>
                        <a id="A_Width" href="javascript:CSSE_changeView('Width');" style="display: none;" class="">Širina</a>
                        <a id="A_Height" href="javascript:CSSE_changeView('Height');" style="display: none;" class="">Visina</a>        
                    </div>
                    <div class="content">
                        <div class="inner" id="properties">
                            <div style="display: none;" id="editFont"><? $this->load->view('style/properties/editFont');?> </div>
                            <div style="display: none;" id="editBackground"><? $this->load->view('style/properties/editBackground');?> </div>
                            <div style="display: none;" id="editBorder"><? $this->load->view('style/properties/editBorder');?> </div>
                            <div style="display: none;" id="editMargin"><? $this->load->view('style/properties/editMargin');?> </div>
                            <div style="display: none;" id="editPadding"><? $this->load->view('style/properties/editPadding');?> </div>
                            <div style="display: none;" id="editWidth"><? $this->load->view('style/properties/editScale');?> </div>
                            <div style="display: none;" id="editHeight"><? $this->load->view('style/properties/editHeight');?> </div>
                        </div>
                    </div>
                    <p class="clear"></p>
                </div>
            </div>
        </div>
        <!--END EDIT STYLE-->    
        <!--PRIVIEW CUSTOM STYLE-->
        <div style="width: 388px; min-height: 380px;" class="box nopadding right">
            <div class="forminner">
                <h4>Pregled uređenog stila</h4>
                <div>
                    <div id="lspollholder-22"><script language="javascript" charset="utf-8" src="<?=base_url()?>assets/js/combine/combine.php?preview=true"></script></div>
                </div>
            </div>
        </div>
        <!--END PRIVIEW CUSTOM STYLE-->    
        <p class="clear"></p>             
        <div class="dividersmall"></div>  
        <!--NOTE & SUBMIT STYLE-->
        <div class="qoptions qoptionssmlbuttons">    
            <table width="100%">
                <tbody>
                    <tr>
                        <td width="300" style="vertical-align: top;">                        
                        </td>
                        <td width="50"></td>
                        <td align="right">
                        </td>
                        <td width="50"></td>
                        <td>
                            <div class="right">
                                <input type="submit" value="<? if (isset($style_data)){echo 'Uredi stil';}else echo'Kreiraj Stil'?>" class="button">
                                <p class="clear"></p>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            <p class="clear"></p>
        </div>
        <!--END NOTE & SUBMIT STYLE-->
        <p class="clear"></p>

    </form>
    <p class="clear"></p>        
</div>
